package com.voicechat.firstmet.utils;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.utils
 * @ClassName: ConstellationUtils
 * @Description: 星座判断类
 * @Author: ljp
 * @CreateDate: 2018/9/20 10:23
 * @Version: 1.0
 */
public class ConstellationUtils {
    public static  String[] contellationArr = {"白羊座","金牛座","双子座",
            "巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座","魔羯座","水瓶座","双鱼座"};

    //contellationArr 星座的数组
    //month 月份
    //day  日
    public static String  getConstellation(int month,int day){
        int point = -1;
        Double date = Double.parseDouble(month + "." + day);
        if (3.21 <= date && 4.19 >= date) {
            point = 0;
        } else if (4.20 <= date && 5.20 >= date) {
            point = 1;
        } else if (5.21 <= date && 6.21 >= date) {
            point = 2;
        } else if (6.22 <= date && 7.22 >= date) {
            point = 3;
        } else if (7.23 <= date && 8.22 >= date) {
            point = 4;
        } else if (8.23 <= date && 9.22 >= date) {
            point = 5;
        } else if (9.23 <= date && 10.23 >= date) {
            point = 6;
        } else if (10.24 <= date && 11.22 >= date) {
            point = 7;
        } else if (11.23 <= date && 12.21 >= date) {
            point = 8;
        } else if (12.22 <= date && 12.31 >= date) {
            point = 9;
        } else if (1.01 <= date && 1.19 >= date) {
            point = 9;
        } else if (1.20 <= date && 2.18 >= date) {
            point = 10;
        } else if (2.19 <= date && 3.20 >= date) {
            point = 11;
        }
        if(point == -1) {
            return contellationArr[2];
        }
        return contellationArr[point];
    }
}
